package org.wattdepot.cli.command;

import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.assertTrue;

/**
 * Test case for sensordata command.
 * 
 * @author Edward Meyer, Bao Huy Ung
 * 
 */
public class TestSensorStamp {

  /**
   * Tests if sensordata command returns proper output compared to a known value.
   */
  @Test
  public void testCorrectOutput() {

    // Populate a list to simulate arguments entered by user.
    List<String> args = new ArrayList<String>();
    args.add("sensordata");
    args.add("SIM_WAIAU_7");
    args.add("timestamp");
    args.add("2009-11-15T02:00:00.000-10:00");

    ListSensorStamp testLSS = new ListSensorStamp();
    String commandOutput = testLSS.doCommand(args);

    // Assert that the output contains value of 88.0 MW for source SIM_WAIAU_7.
    System.out.println("Sampling known value Source: SIM_WAIAU_7 on 2009-11-15T02:00:00.000-10:00");
    assertTrue("Sampling known value Source: SIM_WAIAU_7 on 2009-11-15T02:00:00.000-10:00",
        commandOutput.contains("88.0 MW"));

  }

}
